package d集合.day2.set;

public class Emp implements Comparable<Emp>{
    int salary;
    String name;

    public Emp(int salary, String name) {
        this.salary = salary;
        this.name = name;
    }

    @Override
    public int compareTo(Emp o) {
        //return o.salary-this.salary;
        return this.name.compareTo(o.name);
    }

    @Override
    public String toString() {
        return "Emp{" +
                "salary=" + salary +
                ", name='" + name + '\'' +
                '}';
    }
}
